﻿<?php
	ini_set('display_errors', true);
	error_reporting(E_ALL);
	require 'database.php';
	$databaseSubn = new database();
	$subnett = array();
	$subnett = $databaseSubn->hentSubnett();
	
	$counter = 0;
	echo "<table border='1' id='infoTable' class='tablesorter'>
			<thead>
				 <tr>
				   <th>Navn</th>
				   <th>Sted</th>
				   <th>Vlan</th>
				   <th>Ant adresser</th>
				   <th>Subnett/CIDR</th>
				   <th>Gateway</th>
				   <th>Maske</th>
				   <th>DHCP</th>
				   <th>ACL ut</th>
				   <th>ACL inn</th>
				   <th>Diverse</th>
				 </tr>
			 </thead>
			 <tbody>";
	if (!isset($subnett))
		alertDebug("variabel har ikke blitt satt");
	else {
		while ($counter < count($subnett)) {
			echo "<tr><td>" . $subnett[$counter]['navn'] . "</td>
			<td>" . $subnett[$counter]['sted'] . "</td>
			<td>" . $subnett[$counter]['vlan'] . "</td>
			<td>" . $subnett[$counter]['ant_adr'] . "</td>
			<td>" . $subnett[$counter]['subnett_cidr'] . "</td>
			<td>" . $subnett[$counter]['gateway'] . "</td>
			<td>" . $subnett[$counter]['maske'] . "</td>
			<td>" . $subnett[$counter]['dhcp'] . "</td>
			<td>" . $subnett[$counter]['acl_ut'] . "</td>
			<td>" . $subnett[$counter]['acl_inn'] . "</td>
			<td>" . $subnett[$counter]['diverse'] . "</td>
			</tr>";
			$counter++;
		}
		echo "</tbody></table>";
	}	
?> 